﻿#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <string.h>
#include <math.h>
#include <unordered_map>
using namespace std;

class Solution {
public:
    int longestConsecutive(vector<int>& nums) {
        if (!nums.size()) return 0;
        unordered_set<int> arr(nums.begin(), nums.end());
        int ret = 0;
        for (auto& num : arr)
        {
            if (!arr.count(num - 1))
            {
                int tmp = 1;
                int tmp_num = num;
                while (arr.count(tmp_num + 1))
                {
                    tmp++;
                    tmp_num++;
                }
                ret = max(tmp, ret);
            }
        }
        return ret;
    }
};


int main()
{
    vector<int> arr(10, 0);
    return 0;
}
